package com.taotao.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.common.pojo.TreeNode;
import com.taotao.service.IItemCatService;

/**
 * 结点控制类
 * 
 * @author Administrator
 *
 */
@Controller
@RequestMapping(value = "/item/cat")
public class ItemCatController {
	@Autowired
	private IItemCatService itemCatService;

	/**
	 * 获取当前节点的子节点
	 * 
	 * @param parentId
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/list")
	@ResponseBody
	public List<TreeNode> list(
			@RequestParam(value = "id", defaultValue = "0") Long parentId)
			throws Exception {
		return this.itemCatService.getItemCatList(parentId);
	}
}
